﻿using Microsoft.AspNetCore.Mvc.Filters;
using System;

namespace DemoMVC.Filters
{
    public class SystemAuthenFilter : Attribute, IAuthorizationFilter
    {
        /// <summary>
        ///  身份验证过滤器  
        /// </summary>
        /// <param name="context"></param>
        /// <exception cref="System.NotImplementedException"></exception>
        public void OnAuthorization(AuthorizationFilterContext context)
        {

            var controllerName = context.RouteData.Values["controller"];
            var actionName = context.RouteData.Values["action"];
            var cookie = context.HttpContext.Request.Cookies.Keys;
            Console.WriteLine(cookie);
        }
    }
}
